package kr.hayarobee.jaringobi.model.account.rule;

import kr.hayarobee.jaringobi.exception.NotEnoughMoneyException;

public class SimpleAccountPolicy implements AccountPolicy {

	private int balance;
	
	@Override
	public void add(int money) {
		this.balance += money;
	}

	@Override
	public int get() {
		return this.balance;
	}

	@Override
	public void del(int money) {
		if (this.balance < money)
			throw new NotEnoughMoneyException();

		this.balance -= money;
	}

}
